package com.giaothong.customview;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.giaothong.R;

/**
 * hien thi ket qua direction
 * 
 * @author hp
 */
public class DisplayDirectionView extends LinearLayout {
	private View layout;
	private TextView txtStart, txtEnd, txtDistance, txtDuration;
	public DisplayDirectionView(Context context) {
		super(context);
		init();
	}

	public DisplayDirectionView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	/**
	 * init view
	 */
	private void init() {
		LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		layout = inflater.inflate(R.layout.layout_display_direction, this);
		txtDistance = (TextView) layout.findViewById(R.id.txtDistance);
		txtStart = (TextView) layout.findViewById(R.id.txtStart);
		txtEnd = (TextView) layout.findViewById(R.id.txtEnd);
		txtDuration = (TextView) layout.findViewById(R.id.txtDuration);

	}

	/**
	 * setData
	 * 
	 * @param start
	 * @param end
	 * @param distance
	 * @param duration
	 */
	public void setData(String start, String end, String distance, String duration) {
		txtDistance.setText(distance);
		txtDuration.setText(duration);
		txtEnd.setText(end);
		txtStart.setText(start);
	}


}
